home *** CD-ROM | disk | FTP | other *** search
- Path: wmin.ac.uk!usenet
- From: Idoia Lertxundi <gsoec@wmin.ac.uk>
- Newsgroups: comp.lang.c
- Subject: Another a.s.a.p. to do with structures and pointers and arrays
- Date: 15 Mar 1996 17:22:02 GMT
- Organization: Westminster University
- Message-ID: <4ic8vq$fpn@badger.wmin.ac.uk>
- NNTP-Posting-Host: ss23.scsise.wmin.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.4 sun4m)
- X-URL: news:comp.lang.c
-
- Thank you for the quick response. I am working on it.
-
- I have just reached another stuck point. If you have the humour
- and the time I would apreciate a hand.
-
- Here it goes:
-
- I have a struct:
-
- typedef struct read_file_module_tag
- {
- char code[LENGTHCODE];
- char module_name[LENGTHMODULE_NAME];
- char description[LENGTHDESCRIPTION];
- char module_leader[LENGTHLEADER];
- char result[LENGTHRESULT];
- char corecoursecodes[LENGTHCOURSECODES];
- char optionalcoursecodes[LENGTHCOURSECODES];
- char andprereqcodes[LENGTHREQUISITES];
- char orprereqcodes[LENGTHREQUISITES];
- char andcoreqcodes[LENGTHREQUISITES];
- char orcoreqcodes[LENGTHREQUISITES];
- struct read_file_module_tag *nextfm;
- }FILEMODULE;
-
- look at the char courecoursecodes[XXX] O.K.?
-
- then reading a name1,name2,name3 list with strtok fuction
- I have stored them in a
-
- char *ccoursecodes[10];
-
- then when I try do this copy:
-
- strcpy(mlst->corecoursecodes[i],ccoursecodes[i]);
- the thing goes wrong no casting for argumenet 1.
- and if I change the above structure char type to char *...[]
- does compile but it gives a segmentation fault when running.
- Help!! S.O.S.
-
- If replying send responses to the newsgroup and to me
- gsoec@wmin.ac.uk
- --
-
- [~~~]|~~~\ /~~\ [~~~] /~~\ /~~] /~~~] /~~\ |~~~] /~~~]
- ] [ | [) )( () ) ] [ | () | --- | [~~|\_ ~\( () )| ~] ( (_~
- [___]|___/ \__/ [___]|_||_| \___|[___/ \__/ |___] \___]
-
- ///
- (0 0)
- ------------ooO-(_)-Ooo------------------------
-
- Ms Idoia Lertxundi
-
- Personal mail: gsoec@wmin.ac.uk
- WWW Page: http://www.wmin.ac.uk/~gsoec/
-
- -----------------------------------------------
-
-